/* __auth__ : KunLin */
package com.cskaoyan.controller;


import com.cskaoyan.bean.bo.CommentDeleteBO;
import com.cskaoyan.bean.bo.comment.CommentListBO;
import com.cskaoyan.bean.bo.comment.CommentReplyBO;
import com.cskaoyan.bean.vo.comment.CommentDeleteVO;
import com.cskaoyan.bean.vo.comment.CommentListVO;
import com.cskaoyan.bean.vo.comment.CommentReplyVO;
import com.cskaoyan.service.CommentService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class CommentController {

    @Autowired
    CommentService commentService;


    @RequiresPermissions(value = "admin:comment:list")
    @GetMapping("admin/comment/list")
    public CommentListVO list(CommentListBO commentListBO){
        return commentService.queryAllComment(commentListBO);
    }


    @RequiresPermissions(value = "admin:comment:delete")
    @PostMapping("admin/comment/delete")
    public CommentDeleteVO delete(@RequestBody CommentDeleteBO commentDeleteBO){
        return commentService.delete(commentDeleteBO);
    }

    @RequiresPermissions(value = "admin:order:reply")
    @PostMapping(value = "admin/order/reply")
    public CommentReplyVO reply(@RequestBody CommentReplyBO commentReplyBO){
        return commentService.reply(commentReplyBO);
    }

}
